Post

Replies

Boosts

Views

Activity

Reply to Xcode 14: Publishing changes from within view updates
I get this warning for certain view hierarchies. The following code triggers the warning, but if I move the Button out of the Form or change Form to be a VStack, the warning disappears. It seems like a bug to me, and I have filed a bug report. struct ContentView: View {     @StateObject var viewModel = ViewModel()          var body: some View {         Form {             Button("Save") {                 viewModel.counter += 1             }         }     } } class ViewModel: ObservableObject {     @Published var counter = 0 }
Oct ’22